Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulfil assignment #1848

Merged
merged 32 commits into from
Oct 9, 2024
Merged

Fulfil assignment #1848

merged 32 commits into from
Oct 9, 2024

Conversation

thecalcc
Copy link
Contributor

@thecalcc thecalcc commented Aug 31, 2023

SDESK-7015

What this PR achieves:

  1. Makes fulfil assignment available in both authoring react and angular through superdesk getActions api
  2. Removes the old angular registration of this action

@petrjasek petrjasek added this to the 2.8 milestone Sep 11, 2023
@@ -13,6 +13,9 @@ import {AssignmentsList} from './assignments-overview';
import {IPlanningExtensionConfigurationOptions} from './extension_configuration_options';
import {AutopostIngestRuleEditor} from './ingest_rule_autopost/AutopostIngestRuleEditor';
import {AutopostIngestRulePreview} from './ingest_rule_autopost/AutopostIngestRulePreview';
import ng from 'superdesk-core/scripts/core/services/ng';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensions must not import anything neither from core nor planning. Instead either use superdesk api or planning api via bridge.

Copy link
Member

@tomaskikutis tomaskikutis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix CI

Base automatically changed from authoring-react-post-broadcasting to develop February 6, 2024 13:29
@thecalcc
Copy link
Contributor Author

Update package-json to use cc develop

@thecalcc
Copy link
Contributor Author

Address last comment from #1847

}
},
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether this would appear in authoring-angular as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're asking wether there would be a conflict thus two of the same actions rendering because of being registered in two places yes. I plan to address this in another PR, together with the external-app thingy, as this is something that affects all actions so we need a generic solution.

I think doing a simple collision detection mechanism would suffice for now. If we have an action with the same id coming from extensions as well, we don't push it to the e.g. allActions array. We skip that one, while prioritising existing ones. In react we don't show the angular registered ones, so this should be enough to ignore the react side for now. Later when we remove the angular implementation we will remove the filtering

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensions API have access to authoringReactViewEnabled variable. What about using it to conditionally push the action?

Alternativelly, what about if we dropped the old action and kept only the new one? I did that with planning details widget - dropped the angular version of a widget - and the react one works in both - angular and react based authoring.

icon: 'cut',
onTrigger: () => {
const superdeskArticle = superdesk.entities.article;

// keep in sync with client/planning-extension/src/extension.ts:123
// keep in sync with index.ts:108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better keep relative path. There are lots of index files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the absolute it would be something like superdesk-planning/index.ts

If relative, then this is it, and coincidentally index.ts really is the path & file name, relative to the project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant relative to the project. You get it by right clicking open file tab and choosing "copy relative path"


window.dispatchEvent(event);
// keep in sync with index.ts:79
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link relative path

@tomaskikutis
Copy link
Member

why did you drop "keep in sync" comments?

@thecalcc
Copy link
Contributor Author

thecalcc commented Oct 9, 2024

why did you drop "keep in sync" comments?

Because I've removed the registrations from angular

@thecalcc thecalcc merged commit 486497b into develop Oct 9, 2024
27 checks passed
@thecalcc thecalcc deleted the fulfil-assignment branch October 9, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants